package com.gxa.web.controller;

import com.alibaba.fastjson.JSONObject;
import com.gxa.common.JsonResult;
import com.gxa.service.EmpService;
import com.gxa.service.ParamService;
import com.gxa.service.impl.EmpServiceImpl;
import com.gxa.service.impl.ParamServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/search/basic")
public class SearchBasicInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer currentpage = Integer.parseInt(req.getParameter("page"));
        Integer pagesize = Integer.parseInt(req.getParameter("limit"));
        String describes = req.getParameter("describes");
        System.out.println(describes);
        ParamService paramService = new ParamServiceImpl();
        JsonResult jsonResult = paramService.queryparamlist(currentpage, pagesize, describes);
        resp.setContentType("application/json;charset=utf-8");
        resp.getWriter().write(JSONObject.toJSONString(jsonResult));
    }
}
